package com.example.endwork.bean;

import com.example.endwork.R;

import java.util.ArrayList;

public class GoodsInfo {
    public long rowid; // 行号
    public int sn; // 序号
    public String name; // 名称
    public String desc; // 描述
    public float price; // 价格
    public String thumb_path; // 小图的保存路径
    public String pic_path; // 大图的保存路径
    public int thumb; // 小图的资源编号
    public int pic; // 大图的资源编号
    public int pic_id;
    public String title;
    public boolean bPressed;
    public int id;
    private static int seq = 0;

    public GoodsInfo() {
        rowid = 0L;
        sn = 0;
        name = "";
        desc = "";
        price = 0;
        thumb_path = "";
        pic_path = "";
        thumb = 0;
        pic = 0;
    }

    // 声明一个手机商品的名称数组
    private static String[] mNameArray = {
            "罗莱家纺", "志邦橱柜", "海信（Hisense）", "木栾北欧现代轻奢实木床", "七匹狼", "启蒙亲子读物","克里特"," 拓朴（TOPOTO）"
    };
    // 声明一个手机商品的描述数组
    private static String[] mDescArray = {
            "罗莱家纺 LUOLAI 95%白鹅绒被加厚保暖被芯双人羽绒被子被褥防螨95白鹅绒冬被 1.8米床 220*250cm",
            "志邦橱柜 厨柜整体厨房橱柜定制开放式厨房石英石台面 现代简约安心厨房 1000预约诚意金",
            "海信（Hisense）70E3D-PRO 70英寸 4K超高清 智慧屏 AI声控运动补偿无边全面屏大屏液晶教育电视机 16G大内存",
            "木栾北欧现代轻奢实木床1.8米1.5米双人床婚床经济型主卧简约家具大床 床+床头柜*2+乳胶床垫 180CM*200CM 框架结构",
            "七匹狼【90%白鸭绒 双面穿】2020新款立领保暖男士防雨雪短款羽绒服外套男 黑色 175/92A/XL",
            "20册儿童情绪管理与性格培养绘本 儿童绘本3-6岁睡前故事书 幼儿园绘本图画故事书早教启蒙亲子读物",
            "克里特（kreta）M7 商务手机 超长待机 人脸指纹解锁 全网通 双卡双待 鳄鱼纹 8G+256G",
            " 拓朴（TOPOTO）大卫双驱动旋转拖把桶 免手洗拓扑拖布地拖墩布干湿两用好神拖 D9 1杆2头"
    };
    // 声明一个手机商品的价格数组
    private static float[] mPriceArray = {39, 34,25,35,13,35,90, 89};
    // 声明一个手机商品的小图数组
    private static int[] mThumbArray = {
            R.drawable.s1, R.drawable.s2, R.drawable.s3,R.drawable.s4,
            R.drawable.s5, R.drawable.s6, R.drawable.s7,R.drawable.s8
    };
    // 声明一个手机商品的大图数组
    private static int[] mPicArray = {
            R.drawable.s1d, R.drawable.s2d, R.drawable.s3d,R.drawable.s4d,
            R.drawable.s5d, R.drawable.s6d, R.drawable.s7d,R.drawable.s8d
    };

    public GoodsInfo(int pic_id, String title, String desc) {
        this.pic_id = pic_id;
        this.title = title;
        this.desc = desc;
        this.bPressed = false;
        this.id = this.seq;
        this.seq++;

    }

    // 获取默认的手机信息列表
    public static ArrayList<GoodsInfo> getDefaultList() {
        ArrayList<GoodsInfo> goodsList = new ArrayList<GoodsInfo>();
        for (int i = 0; i < mNameArray.length; i++) {
            GoodsInfo info = new GoodsInfo();
            info.name = mNameArray[i];
            info.desc = mDescArray[i];
            info.price = mPriceArray[i];
            info.thumb = mThumbArray[i];
            info.pic = mPicArray[i];
            goodsList.add(info);
        }
        return goodsList;
    }
    private static int[] gridImageArray = {R.drawable.pic_01, R.drawable.pic_02, R.drawable.pic_03
            , R.drawable.pic_04, R.drawable.pic_05, R.drawable.pic_06, R.drawable.pic_07
            , R.drawable.pic_08, R.drawable.pic_09, R.drawable.pic_10};
    private static String[] gridTitleArray = {"手机", "女装", "运动", "厨具",
            "卫浴", "办公", "家纺", "清洁", "酒类", "生鲜"};

    public static ArrayList<GoodsInfo> getDefaultGrid() {
        ArrayList<GoodsInfo> gridArray = new ArrayList<GoodsInfo>();
        for (int i = 0; i < gridImageArray.length; i++) {
            gridArray.add(new GoodsInfo(gridImageArray[i], gridTitleArray[i], null));
        }
        return gridArray;
    }
    private static int[] stagImageArray = {R.drawable.t1, R.drawable.t2, R.drawable.t3
            , R.drawable.t4, R.drawable.t5, R.drawable.t6, R.drawable.t7
            , R.drawable.t8, R.drawable.t9, R.drawable.t10, R.drawable.t11
            , R.drawable.t12, R.drawable.t13, R.drawable.t14, R.drawable.t15
            , R.drawable.t16, R.drawable.t17, R.drawable.t18, R.drawable.t19
            , R.drawable.t20, R.drawable.t21, R.drawable.t22, R.drawable.t23};
    private static String[] stagTitleArray = {"促销价", "惊爆价", "跳楼价", "白菜价", "清仓价", "割肉价",
            "实惠价", "一口价", "满意价", "打折价", "腰斩价", "无人问津", "算了吧", "大声点",
            "猜你喜欢", "今日促销", "优惠价", "物美价廉", "今日好货", "大甩卖", "白给价", "买一送三", "假一赔三"};

    public static ArrayList<GoodsInfo> getDefaultStag() {

        ArrayList<GoodsInfo> stagArray = new ArrayList<GoodsInfo>();
        for (int i = 0; i < stagImageArray.length; i++) {
            stagArray.add(new GoodsInfo(stagImageArray[i], stagTitleArray[i], null));
        }
        return stagArray;
    }
}